from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.mybase import Tools


# 账户明细
class account_model(Tools):
    path = '/api/user/accountLog'

    def account_action(self, source,type, hd):
        account_data = {
            "source": source,
            "type": type
        }
        account = self.huihua.get(url=self.hosturl+self.path, params=account_data, headers=hd)
        return account.json()


if __name__ == '__main__':
    import requests

    s = requests.session()
    reg = login_model(huihua=s)
    msg = reg.login_action(account="13356786546", password="rr98765", client=2)
    # print(msg)
    get_token = msg["data"]["token"]
    # print(get_token)
    hd = {"token": get_token}

    account = account_model(huihua=s)
    msg = account.account_action(source=2, type=1, hd=hd)
    print(msg)
